package usf.gwt.ui.bootstrap.client;

import usf.gwt.ui.bootstrap.client.core.JqueryUtils;

import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.user.client.DOM;

public class Select extends FormControl<String> {

	protected final static String MULTIPLE = "multiple";
	
	@Override
	protected Element initWidget() {
		return DOM.createSelect();
	}
	
	@Override
	protected void initStyle() {
		getElement().setClassName(DEFAULT_FORM_CONTROL_STYLE);
	}
	
	public void setMultiple(boolean multiple) {
		JqueryUtils.switchAttribute(getElement(), MULTIPLE, multiple);
	}
	public boolean isMultiple() {
		return JqueryUtils.hasAttrib(getElement(), MULTIPLE);
	}
	
	@Override
	protected String getChangedValue(NativeEvent e) {
		return null;
	}
	
}
